package com.itheima.string;
//遍历统计字符串中字符个数
import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入");
        String s = sc.nextLine();
        //完成字符录入操作
        int bigCount = 0;
        int smallCount = 0;
        int numberCount = 0;
        char[] chars = s.toCharArray();//遍历字符串得到每一个字符
        for (int i = 0; i < chars.length; i++) {//判断字符类型,并根据区间收集计数器信息
            if (chars[i] >= 'A' && chars[i] <= 'Z') {
                bigCount++;
            } else if (chars[i] >= 'a' && chars[i] <= 'z') {
                smallCount++;
            } else if (chars[i] >= '0' && chars[i] <= '9') {
                numberCount++;
            }
        }
        System.out.println("大写字母个数为" + bigCount);
        System.out.println("小写字母个数为" + smallCount);
        System.out.println("数字个数为" + numberCount);
    }
}